package com.qiujianwei.study.authcenter.common.config;

import com.qiujianwei.sdk.redis.RedisCache;
import com.qiujianwei.sdk.redis.RedisCacheFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

@Configuration
public class RedisConfig {

    @Autowired
    private RedisTemplate redisTemplate;

    @Bean
    public RedisCache redisCache(RedisConnectionFactory connectionFactory) {
        return RedisCacheFactory.create(redisTemplate, connectionFactory);
    }
}
